home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / etc / init.d / loopback < prev    next >
Text File  |  2008-06-21  |  748b  |  43 lines

  1. #!/bin/sh -e
  2. #
  3. # loopback - brings up the loopback (127.0.0.1) network device so that
  4. #            DHCP and other such things will work
  5. #
  6.  
  7. # Check the package is still installed
  8. [ -x /sbin/ifup ] || exit 0
  9.  
  10. # Get LSB functions
  11. . /lib/lsb/init-functions
  12. . /etc/default/rcS
  13.  
  14. case "$1" in
  15.     start)
  16.     [ -d /var/run/network ] || mkdir /var/run/network
  17.  
  18.     log_begin_msg "Starting basic networking..."
  19.     if ifup --allow auto lo; then
  20.         log_end_msg 0
  21.     else
  22.         log_end_msg $?
  23.     fi
  24.     ;;
  25.     stop)
  26.     log_begin_msg "Stopping basic networking..."
  27.     if ifdown lo; then
  28.         log_end_msg 0
  29.     else
  30.         log_end_msg $?
  31.     fi
  32.     ;;
  33.     restart|force-reload)
  34.     exit 0
  35.     ;;
  36.     *)
  37.     echo "Usage: /etc/init.d/loopback {start|stop|restart|force-reload}"
  38.     exit 1
  39.     ;;
  40. esac
  41.  
  42. exit 0
  43.